Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PDE-668] ottersec final fixes #156

Merged
merged 6 commits into from
Jan 21, 2025
Merged

[PDE-668] ottersec final fixes #156

merged 6 commits into from
Jan 21, 2025

Conversation

ungaro
Copy link
Member

@ungaro ungaro commented Jan 17, 2025

What's new in this PR?

  • It seems that YieldToken::mint hasn't been updated yet to follow the new conversion logic.

  • It seems that YieldToken::redeem hasn't done yieldBuffer check like withdraw yet.

  • Just to be safer, would it make sense to properly implement the rounding direction that you added in ComponentToken comments to the inherited contracts like AggregateToken? It would be better to do this in YieldToken as well just to be safe.

  • For the synchronous redeem in ComponentToken, it seems that the convertToAssets should be called before calling _burn because otherwise it will incorrectly inflate the shares value if the overridden convertToAssets depends on totalSupply.

  • the same issue applies to the synchronous ComponentToken::deposit as well, where transferring the asset should happen after the calculation. In general, we suggest that for actions that might change the value of totalSupply or totalAssets in ERC4626, all calculations should be done before making those changes. Thanks all!

  • For the asynchronous redeem logic in YieldToken, how will you handle the _notifyRedeem conversion rate to be precise?

  • For example, we observed that when users call requestRedeem, the shares will be burned first, which means that the conversion rate in the on-chain side will be inflated until the request is executed (either via withdraw or redeem).

  • Similarly, this applies to future contracts that want to inherit ComponentToken with async features enabled and has dependencies on totalSupply during the conversion logic.

@ungaro ungaro marked this pull request as ready for review January 20, 2025 15:06
@ungaro ungaro requested a review from eyqs January 20, 2025 15:06
Copy link
Member

@eyqs eyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ungaro ungaro merged commit f0960c9 into main Jan 21, 2025
1 check passed
@ungaro ungaro deleted the alp/PDE-668 branch January 21, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants